package com.example.qinghe.service.meeting.impl;

import com.example.qinghe.dao.meeting.MeetingMapper;
import com.example.qinghe.entity.meeting.Mattendance;
import com.example.qinghe.entity.meeting.Meeting;
import com.example.qinghe.service.meeting.MeetingService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;
@Service
public class MeetingServiceImpl implements MeetingService {

    @Autowired
    private MeetingMapper mapper;

    //获取所有会议信息
    @Override
    public List<Meeting> selectAll() {
        List<Meeting> meetings = mapper.selectAll();
        return meetings;
    }

    //获取单个会议信息
    @Override
    public Meeting selectById(Long id) {
        return mapper.selectById(id);
    }

    //获取参会人id 字符串
    @Override
    public String selectAttendeesById(Long id) {
        return mapper.selectAttendeesById(id);
    }

    @Override
    public int countAttendedByMeetingId(Long id) {
        return mapper.countAttendedByMeetingId(id);
    }

    //获取签到者人员信息
    @Override
    public List<Mattendance> selectMattendInfoByMeetingId(Long id) {
        return mapper.selectMattendInfoByMeetingId(id);
    }

    //获取会议室图片
    @Override
    public String selectImgById(Long id) {
        return mapper.selectImgById(id);
    }

    //获取会议地址
    @Override
    public String selectMeetingPlace(Long id) {
        return mapper.selectMeetingPlace(id);
    }

    @Override
    public List<Meeting> selectByRoomId(Long roomId) {
        return mapper.selectByRoomId(roomId);
    }

    @Override
    public List<Meeting>  getMeetingIncludeRoom() {
        return mapper.getMeetingIncludeRoom();
    }

    @Override
    public Meeting getMeetingIncludeRoomById(Long id1) {
        return mapper.getMeetingIncludeRoomById(id1);
    }


    @Override
    public int meetingadd(Meeting meeting) {
        return mapper.meetingadd(meeting);
    }
}
